<?php
namespace app\api\controller;
use app\BaseController;

use GuzzleHttp\Client;

class Official extends BaseController
{
    protected $api = 'https://mp.xhm.net.cn';
    public function getOfficiaConfig(){
        $url = $this->request->param('url/s','');
        if($url){
            $data = [
                'url' => $url
            ];
            $Client = new Client();
            $res = $Client->post($this->api.'/official/buildJsSdkConfig',['form_params'=>$data])->getBody()->getContents();
            return success(json_decode($res,true));
        }else{
            return error('参数错误');
        }

    }
}
